/**
 * Created by Administrator on 2018/6/20.
 */
$CertusJsonAjax.ajax('bidBaseInfo', {
    "processInstanceId": $CertusJsonAjax.getProInstanceId(),
    "stepInstanceId": $CertusJsonAjax.getStepInstanceId()
}, function (res) {
    $$scope.bid = res.data;
    $$scope.bid.processInstanceId =  $CertusJsonAjax.getProInstanceId();
    $$scope.bid.stepInstanceId =  $CertusJsonAjax.getStepInstanceId();
})

$CertusJsonAjax.ajax("queryBidProcessTrace",{
    "processInstanceId": $CertusJsonAjax.getProInstanceId(),
    "stepInstanceId": $CertusJsonAjax.getStepInstanceId()
},function(res){
    $$scope.processs = res.data;
})

function hidefile1() {
    if(certusValidateNotnullPolyfill()){
        $(".hidefile").hide();
    }
}

$$scope.shutdown = function(){
    $CertusJsonAjax.ajax("bidshutdown",$$scope.bid,function(res){
        history.back();
    })
}

$$scope.formSubmitted = function(){

    fileUpload($$scope,function(res){
        // $$scope.bid.specifiedMan = res.data;
        $$scope.bid.nameOfPage = "技术方案";
        $$scope.bid.uploadFilePath = res.data;
        $$scope.bid.pathFrom = "selbidB";
        $CertusJsonAjax.ajax("bidSubmitalter", $$scope.bid, function (res) {
            toLoadHtml(14)
        })
    },function(){
        $CertusJsonAjax.ajax("bidSubmit", $$scope.bid, function (res) {
            history.back();
        })
    },$CertusFormAjax);
}

var fileInstantiation = {
    classCateCode: 'NBCPYZ',
    fileClassCode: 'TBJSWD'
}
var fileInstantiationDisable = {
    classCateCodeDis: true, //文件类目不可修改
    fileClassCodeDis: true //文件类型不可修改
}
//调用初始化方法
initFileUpload($$scope, fileInstantiation, fileInstantiationDisable, $CertusFormAjax);

//文件上传统一字段
function showfile() {
    $(".hidefile").show();
}

function hidefile() {
    $$scope.file = {};
    initFileUpload($$scope, fileInstantiation, fileInstantiationDisable, $CertusFormAjax);
    $(".hidefile").hide();
}

$$scope.getsssbbb = function(bb){
    if(bb == "starting"){
        return "正在进行中";
    }else if(bb == "denied"){
        return "否决";
    }else if(bb == "sentback"){
        return "被退";
    }else if(bb == "others"){
        return "关闭";
    }else if(bb == "completed"){
        return "完成";    }else if(bb == "terminated"){        return "终结";    }    else if(bb == "cancelled"){        return "通过";}
    return "待办";
}

